<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            padding: 0;
            margin: 0;
        }
        
        div {
            width: 500px;
            height: 400px;
            border: 2px solid black;
            margin: auto;
            display: flex;
            /* justify-content: center;
            align-items: flex-end; */
            /* flex-direction: row-reverse; */
            flex-direction: column;
            /* flex-direction: column-reverse; */
            flex-wrap: wrap;
            align-content: space-around;
        }
        
        p {
            width: 100px;
            height: 100px;
        }
        
        p:nth-of-type(1) {
            background-color: pink;
        }
        
        p:nth-of-type(2) {
            background-color: green;
        }
        
        p:nth-of-type(3) {
            background-color: purple;
        }
        
        p:nth-of-type(4) {
            background-color: gray;
        }
        
        p:nth-of-type(5) {
            background-color: red;
        }
        
        p:nth-of-type(6) {
            background-color: indianred;
        }
    </style>
</head>

<body>
    <div>
        <p>1</p>
        <p>2</p>
        <p>3</p>
        <p>4</p>
        <p>5</p>
        <p>6</p>
    </div>
</body>

</html>